#!/usr/bin/env bash
dt="`date -d "$d  0 days ago "  "+%Y-%m-%d"`"
mysql -uroot -proot -hhadoop2<<EOF
use oracleanditem;
select substr(Y.time,1,10),
Z.OLDUNIQUEID,
count(Y.evaluation_id),
SUM(Y.STAR),
SUM(Y.STAR2),
SUM(Y.STAR3),
SUM(Y.STAR4),
SUM(Y.STAR5)
FROM oracleanditem.TBL_EVALUATION AS Y join oracleanditem.TBL_ORGANIZATION AS Z ON Y.ORG_ID=Z.ID
GROUP BY substr(Y.time,1,10),Z.OLDUNIQUEID limit 10;
EOF